3.5.42 \(\int (a+b \cos (c+d x))^4 \sec (c+d x) \, dx\) [442]

Optimal. Leaf size=107 \[ 2 a b \left (2 a^2+b^2\right ) x+\frac {a^4 \tanh ^{-1}(\sin (c+d x))}{d}+\frac {b^2 \left (17 a^2+2 b^2\right ) \sin (c+d x)}{3 d}+\frac {4 a b^3 \cos (c+d x) \sin (c+d x)}{3 d}+\frac {b^2 (a+b \cos (c+d x))^2 \sin (c+d x)}{3 d} \]

[Out]

2*a*b*(2*a^2+b^2)*x+a^4*arctanh(sin(d*x+c))/d+1/3*b^2*(17*a^2+2*b^2)*sin(d*x+c)/d+4/3*a*b^3*cos(d*x+c)*sin(d*x
+c)/d+1/3*b^2*(a+b*cos(d*x+c))^2*sin(d*x+c)/d

________________________________________________________________________________________

Rubi [A]
time = 0.16, antiderivative size = 107, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.263, Rules used = {2872, 3112, 3102, 2814, 3855} \begin {gather*} \frac {a^4 \tanh ^{-1}(\sin (c+d x))}{d}+\frac {b^2 \left (17 a^2+2 b^2\right ) \sin (c+d x)}{3 d}+2 a b x \left (2 a^2+b^2\right )+\frac {4 a b^3 \sin (c+d x) \cos (c+d x)}{3 d}+\frac {b^2 \sin (c+d x) (a+b \cos (c+d x))^2}{3 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + b*Cos[c + d*x])^4*Sec[c + d*x],x]

[Out]

2*a*b*(2*a^2 + b^2)*x + (a^4*ArcTanh[Sin[c + d*x]])/d + (b^2*(17*a^2 + 2*b^2)*Sin[c + d*x])/(3*d) + (4*a*b^3*C
os[c + d*x]*Sin[c + d*x])/(3*d) + (b^2*(a + b*Cos[c + d*x])^2*Sin[c + d*x])/(3*d)

Rule 2814

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[b*(x/d)
, x] - Dist[(b*c - a*d)/d, Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d
, 0]

Rule 2872

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Si
mp[(-b^2)*Cos[e + f*x]*(a + b*Sin[e + f*x])^(m - 2)*((c + d*Sin[e + f*x])^(n + 1)/(d*f*(m + n))), x] + Dist[1/
(d*(m + n)), Int[(a + b*Sin[e + f*x])^(m - 3)*(c + d*Sin[e + f*x])^n*Simp[a^3*d*(m + n) + b^2*(b*c*(m - 2) + a
*d*(n + 1)) - b*(a*b*c - b^2*d*(m + n - 1) - 3*a^2*d*(m + n))*Sin[e + f*x] - b^2*(b*c*(m - 1) - a*d*(3*m + 2*n
 - 2))*Sin[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0]
 && NeQ[c^2 - d^2, 0] && GtQ[m, 2] && (IntegerQ[m] || IntegersQ[2*m, 2*n]) &&  !(IGtQ[n, 2] && ( !IntegerQ[m]
|| (EqQ[a, 0] && NeQ[c, 0])))

Rule 3102

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (
f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*Cos[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 2))), x] + Dist[1/(
b*(m + 2)), Int[(a + b*Sin[e + f*x])^m*Simp[A*b*(m + 2) + b*C*(m + 1) + (b*B*(m + 2) - a*C)*Sin[e + f*x], x],
x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] &&  !LtQ[m, -1]

Rule 3112

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)])*((A_.) + (B_.)*sin[(e
_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*d*Cos[e + f*x]*Sin[e + f*x]*((a +
 b*Sin[e + f*x])^(m + 1)/(b*f*(m + 3))), x] + Dist[1/(b*(m + 3)), Int[(a + b*Sin[e + f*x])^m*Simp[a*C*d + A*b*
c*(m + 3) + b*(B*c*(m + 3) + d*(C*(m + 2) + A*(m + 3)))*Sin[e + f*x] - (2*a*C*d - b*(c*C + B*d)*(m + 3))*Sin[e
 + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C, m}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] &&
  !LtQ[m, -1]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int (a+b \cos (c+d x))^4 \sec (c+d x) \, dx &=\frac {b^2 (a+b \cos (c+d x))^2 \sin (c+d x)}{3 d}+\frac {1}{3} \int (a+b \cos (c+d x)) \left (3 a^3+b \left (9 a^2+2 b^2\right ) \cos (c+d x)+8 a b^2 \cos ^2(c+d x)\right ) \sec (c+d x) \, dx\\ &=\frac {4 a b^3 \cos (c+d x) \sin (c+d x)}{3 d}+\frac {b^2 (a+b \cos (c+d x))^2 \sin (c+d x)}{3 d}+\frac {1}{6} \int \left (6 a^4+12 a b \left (2 a^2+b^2\right ) \cos (c+d x)+2 b^2 \left (17 a^2+2 b^2\right ) \cos ^2(c+d x)\right ) \sec (c+d x) \, dx\\ &=\frac {b^2 \left (17 a^2+2 b^2\right ) \sin (c+d x)}{3 d}+\frac {4 a b^3 \cos (c+d x) \sin (c+d x)}{3 d}+\frac {b^2 (a+b \cos (c+d x))^2 \sin (c+d x)}{3 d}+\frac {1}{6} \int \left (6 a^4+12 a b \left (2 a^2+b^2\right ) \cos (c+d x)\right ) \sec (c+d x) \, dx\\ &=2 a b \left (2 a^2+b^2\right ) x+\frac {b^2 \left (17 a^2+2 b^2\right ) \sin (c+d x)}{3 d}+\frac {4 a b^3 \cos (c+d x) \sin (c+d x)}{3 d}+\frac {b^2 (a+b \cos (c+d x))^2 \sin (c+d x)}{3 d}+a^4 \int \sec (c+d x) \, dx\\ &=2 a b \left (2 a^2+b^2\right ) x+\frac {a^4 \tanh ^{-1}(\sin (c+d x))}{d}+\frac {b^2 \left (17 a^2+2 b^2\right ) \sin (c+d x)}{3 d}+\frac {4 a b^3 \cos (c+d x) \sin (c+d x)}{3 d}+\frac {b^2 (a+b \cos (c+d x))^2 \sin (c+d x)}{3 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.17, size = 128, normalized size = 1.20 \begin {gather*} \frac {24 a b \left (2 a^2+b^2\right ) (c+d x)-12 a^4 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+12 a^4 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+9 b^2 \left (8 a^2+b^2\right ) \sin (c+d x)+12 a b^3 \sin (2 (c+d x))+b^4 \sin (3 (c+d x))}{12 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Cos[c + d*x])^4*Sec[c + d*x],x]

[Out]

(24*a*b*(2*a^2 + b^2)*(c + d*x) - 12*a^4*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + 12*a^4*Log[Cos[(c + d*x)/2
] + Sin[(c + d*x)/2]] + 9*b^2*(8*a^2 + b^2)*Sin[c + d*x] + 12*a*b^3*Sin[2*(c + d*x)] + b^4*Sin[3*(c + d*x)])/(
12*d)

________________________________________________________________________________________

Maple [A]
time = 0.15, size = 98, normalized size = 0.92

method result size
derivativedivides \(\frac {a^{4} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+4 a^{3} b \left (d x +c \right )+6 a^{2} b^{2} \sin \left (d x +c \right )+4 a \,b^{3} \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+\frac {b^{4} \left (\cos ^{2}\left (d x +c \right )+2\right ) \sin \left (d x +c \right )}{3}}{d}\) \(98\)
default \(\frac {a^{4} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+4 a^{3} b \left (d x +c \right )+6 a^{2} b^{2} \sin \left (d x +c \right )+4 a \,b^{3} \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+\frac {b^{4} \left (\cos ^{2}\left (d x +c \right )+2\right ) \sin \left (d x +c \right )}{3}}{d}\) \(98\)
risch \(4 a^{3} b x +2 a \,b^{3} x -\frac {3 i {\mathrm e}^{i \left (d x +c \right )} a^{2} b^{2}}{d}-\frac {3 i {\mathrm e}^{i \left (d x +c \right )} b^{4}}{8 d}+\frac {3 i {\mathrm e}^{-i \left (d x +c \right )} a^{2} b^{2}}{d}+\frac {3 i {\mathrm e}^{-i \left (d x +c \right )} b^{4}}{8 d}+\frac {a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}-\frac {a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}+\frac {\sin \left (3 d x +3 c \right ) b^{4}}{12 d}+\frac {\sin \left (2 d x +2 c \right ) a \,b^{3}}{d}\) \(169\)
norman \(\frac {\left (4 a^{3} b +2 a \,b^{3}\right ) x +\left (4 a^{3} b +2 a \,b^{3}\right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (16 a^{3} b +8 a \,b^{3}\right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (16 a^{3} b +8 a \,b^{3}\right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (24 a^{3} b +12 a \,b^{3}\right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {2 b^{2} \left (6 a^{2}-2 a b +b^{2}\right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {2 b^{2} \left (6 a^{2}+2 a b +b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {2 b^{2} \left (54 a^{2}-6 a b +5 b^{2}\right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}+\frac {2 b^{2} \left (54 a^{2}+6 a b +5 b^{2}\right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}+\frac {a^{4} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {a^{4} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) \(307\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*cos(d*x+c))^4*sec(d*x+c),x,method=_RETURNVERBOSE)

[Out]

1/d*(a^4*ln(sec(d*x+c)+tan(d*x+c))+4*a^3*b*(d*x+c)+6*a^2*b^2*sin(d*x+c)+4*a*b^3*(1/2*sin(d*x+c)*cos(d*x+c)+1/2
*d*x+1/2*c)+1/3*b^4*(cos(d*x+c)^2+2)*sin(d*x+c))

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 95, normalized size = 0.89 \begin {gather*} \frac {12 \, {\left (d x + c\right )} a^{3} b + 3 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} a b^{3} - {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} b^{4} + 3 \, a^{4} \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + 18 \, a^{2} b^{2} \sin \left (d x + c\right )}{3 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cos(d*x+c))^4*sec(d*x+c),x, algorithm="maxima")

[Out]

1/3*(12*(d*x + c)*a^3*b + 3*(2*d*x + 2*c + sin(2*d*x + 2*c))*a*b^3 - (sin(d*x + c)^3 - 3*sin(d*x + c))*b^4 + 3
*a^4*log(sec(d*x + c) + tan(d*x + c)) + 18*a^2*b^2*sin(d*x + c))/d

________________________________________________________________________________________

Fricas [A]
time = 0.40, size = 98, normalized size = 0.92 \begin {gather*} \frac {3 \, a^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, a^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 12 \, {\left (2 \, a^{3} b + a b^{3}\right )} d x + 2 \, {\left (b^{4} \cos \left (d x + c\right )^{2} + 6 \, a b^{3} \cos \left (d x + c\right ) + 18 \, a^{2} b^{2} + 2 \, b^{4}\right )} \sin \left (d x + c\right )}{6 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cos(d*x+c))^4*sec(d*x+c),x, algorithm="fricas")

[Out]

1/6*(3*a^4*log(sin(d*x + c) + 1) - 3*a^4*log(-sin(d*x + c) + 1) + 12*(2*a^3*b + a*b^3)*d*x + 2*(b^4*cos(d*x +
c)^2 + 6*a*b^3*cos(d*x + c) + 18*a^2*b^2 + 2*b^4)*sin(d*x + c))/d

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \cos {\left (c + d x \right )}\right )^{4} \sec {\left (c + d x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cos(d*x+c))**4*sec(d*x+c),x)

[Out]

Integral((a + b*cos(c + d*x))**4*sec(c + d*x), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 212 vs. \(2 (101) = 202\).
time = 0.49, size = 212, normalized size = 1.98 \begin {gather*} \frac {3 \, a^{4} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, a^{4} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + 6 \, {\left (2 \, a^{3} b + a b^{3}\right )} {\left (d x + c\right )} + \frac {2 \, {\left (18 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 6 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 3 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 36 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 18 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3}}}{3 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cos(d*x+c))^4*sec(d*x+c),x, algorithm="giac")

[Out]

1/3*(3*a^4*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 3*a^4*log(abs(tan(1/2*d*x + 1/2*c) - 1)) + 6*(2*a^3*b + a*b^3)
*(d*x + c) + 2*(18*a^2*b^2*tan(1/2*d*x + 1/2*c)^5 - 6*a*b^3*tan(1/2*d*x + 1/2*c)^5 + 3*b^4*tan(1/2*d*x + 1/2*c
)^5 + 36*a^2*b^2*tan(1/2*d*x + 1/2*c)^3 + 2*b^4*tan(1/2*d*x + 1/2*c)^3 + 18*a^2*b^2*tan(1/2*d*x + 1/2*c) + 6*a
*b^3*tan(1/2*d*x + 1/2*c) + 3*b^4*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 + 1)^3)/d

________________________________________________________________________________________

Mupad [B]
time = 0.82, size = 158, normalized size = 1.48 \begin {gather*} \frac {3\,b^4\,\sin \left (c+d\,x\right )}{4\,d}+\frac {2\,a^4\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {b^4\,\sin \left (3\,c+3\,d\,x\right )}{12\,d}+\frac {a\,b^3\,\sin \left (2\,c+2\,d\,x\right )}{d}+\frac {6\,a^2\,b^2\,\sin \left (c+d\,x\right )}{d}+\frac {4\,a\,b^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {8\,a^3\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*cos(c + d*x))^4/cos(c + d*x),x)

[Out]

(3*b^4*sin(c + d*x))/(4*d) + (2*a^4*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (b^4*sin(3*c + 3*d*x))/(
12*d) + (a*b^3*sin(2*c + 2*d*x))/d + (6*a^2*b^2*sin(c + d*x))/d + (4*a*b^3*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (
d*x)/2)))/d + (8*a^3*b*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d

________________________________________________________________________________________